|
$value)
{
// and print out the values
//echo $value ;
$rg = $_SESSION['regchk'][$value] ;
//echo '
';
$ins = $DBcon->prepare("insert into plis(reg) values('$rg')") ;
$ins->execute() ;
}
//get alpha grades
//if(!isset($_SESSION['ok'])) header("location: printsr.php") ;
$af = 'Alpha / Distinction' ;
$alpha = $DBcon->prepare("select * from average where grades = :a ") ;
$alpha->bindparam(':a', $af) ;
$alpha->execute() ;
if($alpha->rowcount() > 0)
{
$rowds = $alpha->FETCH(PDO::FETCH_ASSOC) ;
$as = $rowds['start'] ;
$ae = $rowds['end'] ;
}
//get credits grade
$cd = 'Credit' ;
$crd = $DBcon->prepare( "select * from average where grades = :c ") ;
$crd->bindparam(':c', $cd) ;
$crd->execute() ;
if($crd->rowcount() > 0)
{
$rowcr = $crd->FETCH(PDO::FETCH_ASSOC) ;
$cs = $rowcr['start'] ;
$ce = $rowcr['end'] ;
}
//get pass grade
$p = 'Pass' ;
$pass = $DBcon->prepare("select * from average where grades = :p ") ;
$pass->bindparam(':p' , $p) ;
$pass->execute() ;
if($pass->rowcount() > 0)
{
$rowps = $pass->FETCH(PDO::FETCH_ASSOC) ;
$ps = $rowps['start'] ;
$pe = $rowps['end'] ;
}
//get failure grades
$f = 'Fail' ;
$fail =$DBcon->prepare("select * from average where grades =:f ") ;
$fail->bindparam(':f' , $f) ;
$fail->execute() ;
if($fail->rowcount() > 0)
{
$rowfl = $fail->FETCH(PDO::FETCH_ASSOC) ;
$fs = $rowfl['start'] ;
$fe = $rowfl['end'] ;
}
//get promotional average
$pa = 'Promotion Average' ;
$pro = $DBcon->prepare("select * from average where grades = :pr ");
$pro->bindparam(':pr' , $pa) ;
$pro->execute() ;
if($pro->rowcount() > 0)
{
$rowpro = $pro->FETCH(PDO::FETCH_ASSOC) ;
$prs = $rowpro['start'] ;
$pre = $rowpro['end'] ;
}
*/
}
function generateTeacherComment($average) {
if ($average >= 80) {
$comment = "Excellent performance! Shows exceptional understanding of all subjects. Keep it up!";
} elseif ($average >= 70) {
$comment = "Very good performance. Shows strong grasp of most concepts. Continue the good work.";
} elseif ($average >= 60) {
$comment = "Good performance. Shows satisfactory understanding. Room for improvement in some areas.";
} elseif ($average >= 50) {
$comment = "Average performance. Needs to work harder and be more consistent in studies.";
} elseif ($average >= 40) {
$comment = "Below average. Requires extra help and regular practice to improve.";
} else {
$comment = "Unsatisfactory performance. Immediate intervention required. Extra classes recommended.";
}
return $comment;
}
//end....
//VARIABLES
//$pin = $_SESSION['pin'] ;
$classid = $_SESSION['class'] ;
$schyear = $_SESSION['yr'] ;
$term = $_SESSION['tm'] ;
//$regno = $_SESSION["rgno"] ;
// $classtotal = $_SESSION["classnumc"] ;
//$level = substr($classid, 0, 4);
//$level1 = substr($classid, 0, 5);
$myArr = array();
$array_regno = array() ;
//get student name from students table
//GET NUMBER IN CLASS IN THIRD TERM
$sqlpoc = $DBcon->prepare(" select distinct regno from marks where (term =:tm and acyear = :yr ) and klass= :kls " );
$sqlpoc->bindparam(':tm' , $term) ;
$sqlpoc->bindparam(':yr' , $schyear) ;
$sqlpoc->bindparam(':kls' , $classid) ;
$sqlpoc->execute() ;
$numbt = $sqlpoc->rowcount() ;
while($row_reg = $sqlpoc->fetch(pdo::FETCH_ASSOC))
{
$rg = $row_reg['regno'] ;
$array_regno[] = $rg ;
//echo $rg ;
}
//$_SESSION["classnumt"] = $numbt ;
//END
//get minimum no of subject
/*
$level = getm($classid) ;
$sqlm = $DBcon->prepare("select * from subjno where (classlevel = :kls and term = :tm) and yr = :y ") ;
$sqlm->bindparam(':kls' , $level) ;
$sqlm->bindparam(':tm' , $term) ;
$sqlm->bindparam(':y',$schyear) ;
$sqlm->execute() ;
$rowm = $sqlm->FETCH(PDO::FETCH_ASSOC) ;
$min = $rowm['nos'] ;
//end....
*/
//get next term fees and resumption
/*
$sqlt = $DBcon->prepare("select * from next" ) ;
//$sqlname->bindparam(':reg' , $regno) ;
$sqlt->execute() ;
if ($sqlt->rowcount() > 0)
{
$rowat = $sqlt->FETCH(PDO::FETCH_ASSOC) ;
$nxtf = $rowat['fees'] ;
$nxtr = $rowat['resume'] ;
}
*/
?>
prepare("select * from plis") ;
//$getlist->execute() ;
foreach ($array_regno as $rg) {
$myArr = array() ;
$subjp = array() ;
$maya = array() ;
$myarray = array() ;
$arresult = array() ;
$regno = $rg ;
$rlist[] = $regno ;
$streamno1 = array();
$arresult1 = array() ;
$myarray1 = array() ;
$maya1 = array() ;
$myArr1 = array() ;
$psubj = array() ;
$pscore = array() ;
$sqlname = $DBcon->prepare("select * from students_info where regno = :reg " ) ;
$sqlname->bindparam(':reg' , $regno) ;
$sqlname->execute() ;
if ($sqlname->rowcount() > 0)
{
$rowa = $sqlname->FETCH(PDO::FETCH_ASSOC) ;
$names = $rowa['fullname'] ;
}
?>
|